package com.kaifamiao.month03.day0331.bank.model;

public class Account {

    String name;
    String pass;
    double money;
    int age;
    char gender;
    String phone;
    long card;

    public Account() {
    }

    public Account(String name, String pass, String phone, int age, char gender, long card) {
        this.name = name;
        this.pass = pass;
        setPhone(phone);
        this.age = age;
        this.gender = gender;
        this.card = card;
    }

    public long getCard() {
        return card;
    }

    public void setCard(long card) {
        this.card = card;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        if (phone.length() == 11) {
            this.phone = phone;
        }
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money, int i) {
        if (i == 1) this.money += money;
        else this.money -= money;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return "姓名： " + this.name + " ，性别： " + this.gender + " ，年龄： " + this.age +
                "，电话： " + this.phone + "，卡号：" + this.card;
    }

}
